package com.tfswx.jcyw.ruleenginedesigner.dto.gzgl;

import com.alibaba.fastjson.JSON;
import com.tfswx.ruleengine.compute.bean.GzBdsDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author ricky
 * @date 2021/5/16
 */
@Data
public class GzdyByGzbmQueryOutputDTO {
    @ApiModelProperty(value = "")
    private String gzbm;

    @ApiModelProperty(value = "")
    private String gzmc;

    @ApiModelProperty(value = "")
    private String gzms;

    @ApiModelProperty(value = "")
    private String gzflbm;

    @ApiModelProperty(value = "")
    private GzBdsDTO gzbds;

    @ApiModelProperty(value = "")
    private String bmjh;

    @ApiModelProperty(value = "")
    private String zdjh;

    @ApiModelProperty(value = "")
    private String gzpz;

    public List<String> getBmList() {
        if (StringUtils.isNotBlank(bmjh)) {
            return JSON.parseArray(bmjh).toJavaList(String.class);
        }
        return new ArrayList<>();
    }

    public List<String> getZdList() {
        if (StringUtils.isNotBlank(zdjh)) {
            return JSON.parseArray(zdjh).toJavaList(String.class);
        }
        return new ArrayList<>();
    }
}
